load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "yacc",
    srcs = [
        "lex.go",
        "node.go",
        "parse.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/internal/rsg/yacc",
    visibility = ["//pkg:__subpackages__"],
    deps = ["@com_github_cockroachdb_errors//:errors"],
)

go_test(
    name = "yacc_test",
    size = "small",
    srcs = ["parse_test.go"],
    data = ["//pkg/sql/parser:sql.y"],
    embed = [":yacc"],
    deps = [
        "//pkg/build/bazel",
        "//pkg/util/log",
    ],
)
